home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0574.ZIP
/
FCLOSE.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-12-07
|
633b
|
46 lines
include compiler.inc
ttl FCLOSE, 1.05, 10-16-86, jwk
;close io stream
dseg
exterr
cseg
xtfs <close,$strhand>
procdef fclose, <<stream, ptr>>
pushreg
pushds
moverr 0
callit $strhand <<stream,ptr>>
inc ax
jz ex ;bad pointer, ERR=0
dec ax
callit close,<<ax,reg>>
or ax,ax ;returned NULL
jz ok ;yes, okay
;
seteof:
moverr ax ;no, set error code
mov ax,-1 ;and return EOF
jmp short ex
;
ok:
ldptr si,stream
xor ax,ax
mov 4[si],al ;ERCD
mov 3[si],al ;CRFLG
mov 2[si],al ;MODE - not open
dec ax
mov [si],ax ;no UGC
inc ax
ex: pret
pend fclose
finish